package com.bw.polling.net

import com.blankj.utilcode.util.ApiUtils.Api
import com.bw.base.constants.ApiConst
import com.bw.http.utils.Res
import com.bw.polling.entity.PollingEntity
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path

interface ApiService {

    @GET(ApiConst.URL_GET_PALLING)
    suspend fun getPolling():Res<List<PollingEntity>>

    @POST(ApiConst.URL_ADD_PALLING)
    suspend fun addPolling(@Body pollingEntity: PollingEntity):Res<PollingEntity>
    @DELETE(ApiConst.URL_DELETE_PALLING)
    suspend fun delPolling(@Path("id")id:Int):Res<Boolean>
}